home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
zendisk1.zip
/
LST7-21.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
648b
|
33 lines
;
; *** Listing 7-21 ***
;
; Measures the performance of multiplying by 80 with
; a table look-up.
;
jmp Skip
;
; Table of multiples of 80, covering the range 80 times 0
; to 80 times 479.
;
Times80Table label word
TIMES_80_SUM=0
rept 480
dw TIMES_80_SUM
TIMES_80_SUM=TIMES_80_SUM+80
endm
;
Skip:
sub ax,ax
call ZTimerOn
rept 1000
mov ax,10 ;so we have a constant value to
; multiply by
mov bx,ax ;put the factor where we can use it
; for a table look-up
shl bx,1 ;times 2 for use as an index in a
; word-sized look-up table
mov ax,[Times80Table+bx]
;look up the answer
endm
call ZTimerOff